The BLAST computer program presently uses computer simulations to give accurate estimates of statistical significance for sequence matches. Recent advances in the statistical theory of gapped sequence alignments indicates a need for further rigorous mathematical results in the underlying statistical theory. This project aims to provide those results. Edge effects are present because real sequences have limited lengths and appear as a correction term in an asymptotic expansion of the probability of sequence matching. This edge effect is likely to be more important in the statistics of matching with gaps than it was in the statistics of matching without gaps, because gapped matches tend to be longer, exhausting the sequences being matched more easily. As a byproduct, this project has produced some new analytic results that are likely to be useful in detecting non-random positioning of genomic markers. These analytic results follow from continuous-time analogs for the discrete-time results for random sums.